package com.yurui.service.impl;

import com.yurui.mapper.AccountMapper;
import com.yurui.service.AccountService;
import io.seata.core.context.RootContext;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @author : yurui
 * @date : 2023/10/22
 * @TIME : 20:04
 * @project : parentCloud
 */

@Service
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountMapper accountMapper;

    @Override
    public void decrease(Long userId, float money) {
        System.out.println("全局事务ID=" + RootContext.getXID());
//        int a = 10/0;
        accountMapper.decrease(userId, money);
    }
}
